<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        input {
            height: 50px;
            width: 300px;
        }
    </style>
</head>

<body>
    <input type="text">
    <script>
        const inp = document.querySelector('input')
        inp.addEventListener('keydown', function () {
            console.log('按下');

        })
        inp.addEventListener('keyup', function () {
            console.log('抬起');

        })
        inp.addEventListener('input', function () {
            console.log(inp.value);

        })
    </script>
</body>

</html>